home *** CD-ROM | disk | FTP | other *** search
- program Ice;
- { Sample security routine }
-
- {$R Ice.Rsrc}
- {$U-}
- {$B+}
- {$T APPLCAPD}
-
- uses Memtypes,QuickDraw,OSIntf,ToolIntf,PackIntf;
-
- procedure Initialize; { Initialize everything }
- begin
- InitGraf(@thePort);
- InitFonts;
- InitWindows;
- InitMenus;
- TEInit;
- InitDialogs(NIL);
- FlushEvents(everyEvent,0)
- end; { of Initialize }
-
- procedure DoPet;
-
- procedure DoScum;
-
- const
- theAlert = 1002;
-
- var
- thebutton : integer;
-
- begin
- thebutton := StopAlert(theAlert,NIL);
- halt
- end;
-
- const
- DialogID = 1003;
- OKBtn = 1;
- petName = 3;
-
- var
- theDialog : DialogPtr;
- itemHit,theType : integer;
- NameHandle : handle;
- theName : Str255;
- thebox : rect;
-
- begin
- theDialog := GetNewDialog(DialogID,nil, pointer (-1));
- SelIText(theDialog,petName,0,10);
- GetDItem (theDialog, petName, theType, NameHandle, theBox);
- ShowWindow(theDialog);
- ModalDialog(Nil,itemHit);
- GetIText(NameHandle,theName);
- DisposDialog(theDialog);
- UprString(theName,false);
- if (theName <> 'FRED' ) then DoScum
- end; { of DoPet }
-
- const
- DialogID = 1001;
- OKBtn = 1;
- PamBtn = 2;
- Cliff_NBtn = 3;
- Cliff_GBtn = 4;
- ChrisBtn = 5;
- UserBtn = 6;
- btnOff = 0;
- btnOn = 1;
- WindowID = 1001;
- Welcome = 'Welcome';
-
- var
- theDialog : DialogPtr;
- radHdl : handle;
- itemHit,theType,Item,
- theName : integer;
- theBox : rect;
- Access : boolean;
- TheWindow : WindowPtr;
- clicked : boolean;
-
- begin
- Initialize;
- theDialog := GetNewDialog(DialogID,nil, pointer (-1));
- GetDItem (theDialog, PamBtn, theType, radHdl, theBox);
- SetCtlValue(ControlHandle(radHdl),btnOn);
- InitCursor;
- ShowWindow(theDialog);
- repeat
- ModalDialog(Nil,itemHit);
- for item := PamBtn to UserBtn Do
- begin
- GetDItem (theDialog, item, theType, radHdl, theBox);
- SetCtlValue(ControlHandle(radHdl),btnOff);
- end;
- GetDItem (theDialog, itemHit, theType, radHdl, theBox);
- SetCtlValue(ControlHandle(radHdl),btnOn);
- if ( itemHit <> OKBtn ) then theName := itemHit;
- until( itemHit = OKBtn );
- DisposDialog(theDialog);
- if ( theName = UserBtn ) then Access := false else DoPet;
- theWindow := GetNewWindow(WindowID,Nil,Pointer(-1));
- SetPort(theWindow);
- TextFont(London);
- TextSize(18);
- MoveTo(200,50);
- DrawString(Welcome);
- repeat
- clicked := button
- until clicked
- end. { of Ice }